package com.book.upms.ip.hystrix.impl;

import com.book.common.api.impl.BaseHystrixImpl;
import com.book.upms.ip.dto.BlackIpDto;
import com.book.upms.ip.vo.BlackIpVo;
import com.book.upms.ip.hystrix.IBlackIpHystrix;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * Description：IP黑名单 HystrixImpl
 * @Author： leo
 * @CreateDate： 2020-12-31
 * @Email： leo.xiong@suyun360.com
 * Version: 1.0
 */
@Slf4j
@Component
public class BlackIpHystrixImpl extends BaseHystrixImpl<BlackIpDto, BlackIpVo> implements FallbackFactory<IBlackIpHystrix>, IBlackIpHystrix {

    @Override
    public IBlackIpHystrix create(Throwable e) {
        log.error("upms-public.BlackIpHystrixImpl.IP黑名单服务调用失败:{}", e.getMessage());
        e.printStackTrace();
        return new BlackIpHystrixImpl();
    }
}
